package com.youngwang.annotation;

/**
 * @author youngwang
 *         Date: 2017/6/15
 */
public class Anno {

    @FieldMeta(id = true, name = "序列号")
    private Integer id;
    @FieldMeta(name = "姓名")
    private String name;


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public int hashCode() {
        return this.name.hashCode() & this.id.hashCode() ;
    }

    @Override
    public boolean equals(Object obj) {
        if(this == obj){
            return true;
        }

        if(null == obj || obj.getClass()!= this.getClass()){
            return false;
        }

        if(obj instanceof Anno) {
            Anno anno = (Anno) obj;
            return anno.getName().equals(this.name) && anno.getId().equals(this.id);
        }

        return false;
    }
}
